import * as actionTypes from "./constants"
import { reqmy } from "@/api/index"

export const changeMyData = (data) => {
    return {
        type: actionTypes.CHANGE_MYDATA,
        data
    }
}

export const getMyData = () => {
    return (dispatch) => {
        reqmy()
            .then((res) => {
                // console.log(res);
                dispatch(changeMyData(res.data.data))
            })
            .catch((e) => {
                console.log('出错了', e);
            })
    }
}